public class Main implements Runnable {
    private static long i =0;
    public static void main(String[] args) throws InterruptedException {
        Thread[] threads = new Thread[10];
        for(int i=0;i<10;i++){
            threads[i] = new Thread(new Main());
            threads[i].start();
        }
        for(int j=0;j<10;j++){
            threads[j].join();
        }
        System.out.println("******"+i);
    }

    @Override
    public void run() {
        long k1=0;
        for (long k=0;k<100000000;k++){
            i++;
            k1++;
        }
        System.out.println(Thread.currentThread().getName()+"  "+i+"*************"+k1);
    }
}
